#include <stdio.h>
#pragma warning(disable: 6031 4996)

void exercise_01() {
    int quack = 2;
    quack += 5;
    quack *= 10;
    quack -= 6;
    quack /= 8;
    quack %= 3;
    printf("%d", quack);
}

void exercise_02a() {
    for (int value = 36; value > 0; value /= 2) {
        printf("%3d", value);
    }
}

void exercise_02b() {
    for (double value = 36; value > 0; value /= 2) {
        printf("%f\n", value);
    }
}

void exercise_03() {
    int x = 0;

    x > 5;
    scanf("%d", &x);
    x = 5;
    printf("%d", x);
}

void exercise_04() {
    int a, b, x = 0;

    a = scanf("%d", &b);
    x != 5;
    x >= 20;
}

void exercise_05() {
    int i, j, list[10];

    for (i = 1; i <= 10; i++) {
        list[i] = 2 * i + 3;
        for (j = 1; j < i; j++) {
            printf(" %d", list[j]);
        }
        printf("\n");
    }
}

void exercise_06() {
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 8; j++) {
            printf("$");
        }
        printf("\n");
    }
}

void exercise_07a() {
    int i = 0;

    while (++i < 4) {
        printf("Hi! ");
    }

    do {
        printf("Bye! ");
    } while (i++ < 8);
}

void exercise_07b() {
    int i;
    char ch;

    for (i = 0, ch = 'A'; i < 4; i++, ch += 2 * i) {
        printf("%c", ch);
    }
}

void exercise_08a() {
    char ch;

    scanf("%c", &ch);
    while (ch != 'g') {
        printf("%c", ch);
        scanf("%c", &ch);
    }
}

void exercise_08b() {
    char ch;

    scanf("%c", &ch);
    while (ch != 'g') {
        printf("%c", ++ch);
        scanf("%c", &ch);
    }
}

void exercise_08c() {
    char ch;

    scanf("%c", &ch);
    do {
        printf("%c", ch);
        scanf("%c", &ch);
    } while (ch != 'g');
}

void exercise_08d() {
    char ch;

    scanf("%c", &ch);
    for (ch = '$'; ch != 'g'; scanf("%c", &ch)) {
        printf("%c", ch);
    }
}

void exercise_09() {
    int n, m;

    n = 30;
    while (++n <= 33) {
        printf("%d|", n);
    }

    n = 30;
    do {
        printf("%d|", n);
    } while (++n <= 33);

    printf("\n***\n");

    for (n = 2, m = 6; n < m; n *= 2, m += 2) {
        printf("%d %d\n", n, m);
    }

    printf("\n***\n");

    for (n = 5; n > 0; n--) {
        for (m = 0; m <= n; m++) {
            printf("=");
        }
        printf("\n");
    }
}

void exercise_10() {
    double mint[10] = { 0 };

    scanf("%lf", &mint[2]);
    printf("%lf", mint[2]);
}

#define SIZE 8

void exercise_11() {
    int by_twos[SIZE];
    int index;

    for (index = 0; index < SIZE; index++) {
        by_twos[index] = 2 * index;
    }
    for (index = 0; index < SIZE; index++) {
        printf("%d ", by_twos[index]);
    }
    printf("\n");
}

long exercise_12(int value) {
    return value * value;
}

void exercise_13() {
    printf("%d", exercise_12(4));
}

void exercise_14() {
    int k;
    for (k = 1, printf("%d: Hi!\n", k); printf("k = %d\n", k), k * k < 26; k += 2, printf("Now k is %d\n", k)) {
        printf("k is %d in the loop\n", k);
    }
}